package xyz.xtt.pay.service;

import java.util.Collection;
import java.util.List;

import xyz.xtt.asset.client.request.CancelTransactionRequest;
import xyz.xtt.asset.client.request.ConfirmTransactionRequest;
import xyz.xtt.asset.client.request.MakeTransactionRequest;
import xyz.xtt.asset.client.response.AssetAccountResponse;
import xyz.xtt.asset.client.response.AssetAllInfoResponse;
import xyz.xtt.asset.client.response.AssetExtInfoResponse;
import xyz.xtt.asset.client.response.AssetInfoResponse;
import xyz.xtt.asset.client.response.AssetNoResponse;
import xyz.xtt.asset.client.response.AssetStaticResponse;
import xyz.xtt.asset.client.response.AssetTransactionResponse;
import xyz.xtt.asset.client.response.AssetUserLogResponse;
import xyz.xtt.asset.client.response.CancelOrderResponse;
import xyz.xtt.asset.client.response.ConfirmOrderResponse;
import xyz.xtt.asset.client.response.TransactionResponse;
import xyz.xtt.equity.api.dto.GetBenefitPurchaseRecordRequest;
import xyz.xtt.equity.api.dto.GetOnSaleBenefitPackageRequest;
import xyz.xtt.equity.api.dto.SaveBenefitPurchaseUnPayDto;
import xyz.xtt.equity.api.dto.TblBenefitPackageDto;
import xyz.xtt.equity.api.dto.TblBenefitPurchaseRecordDto;
import xyz.xtt.equity.client.request.GetUnPayBenefitPurchaseRecordRequest;
import xyz.xtt.equity.client.request.HandlePayCancelRequest;
import xyz.xtt.equity.client.request.HandlePaySuccessRequest;
import xyz.xtt.equity.client.request.TblUserBenefitDto;
import xyz.xtt.exchange.response.AssetAuditResponse;
import xyz.xtt.pay.client.response.TblPayOrderDto;
import xyz.xtt.user.client.response.UserInfoResponse;

/**
 * @author huqibo
 * @date 2025/03/21
 */
public interface IInnerService {

	/**
	 * 根据assetId查资产详情
	 * 
	 * @param assetId
	 * @return
	 */
	AssetInfoResponse infoWithAssetId(Long assetId);

	/**
	 * 资产全部详情
	 * 
	 * @param assetId
	 * @return
	 */
	AssetAllInfoResponse allInfoAssetId(Long assetId);

	/**
	 * 资产全部详情
	 * 
	 * @param assetId
	 * @return
	 */
	AssetAllInfoResponse allInfoGoodsId(String goodsId);

	/**
	 * 是否有365礼盒
	 * 
	 * @param appUid
	 * @return
	 */
	Boolean hasGift365(Long appUid);

	/**
	 * 查询用户交易单状态
	 * 
	 * @param assetId
	 * @param appUid
	 * @return
	 */
	TransactionResponse queryNotPayOrder(Long assetId, String appUid);

	/**
	 * 创建交易
	 * 
	 * @param makeOrder
	 * @return
	 */
	AssetTransactionResponse makeTransaction(MakeTransactionRequest makeOrder);

	/**
	 * 确认交易
	 * 
	 * @param confirmTransactionRequest
	 * @return
	 */
	ConfirmOrderResponse confirmTransaction(ConfirmTransactionRequest confirmTransactionRequest);

	/**
	 * 取消交易
	 * 
	 * @param cancelTransactionRequest
	 * @return
	 */
	CancelOrderResponse cancelTransaction(CancelTransactionRequest cancelTransactionRequest);

	/**
	 * @param uid
	 * @param benefitCode
	 * @return
	 */
	TblUserBenefitDto getLatestUserBenefit(String uid, String benefitCode);

	TransactionResponse transactionInfo(Long orderId);

	AssetInfoResponse infoWithGoodsId(String goodsId);

	/**
	 * 查询单条权益包
	 * 
	 * @param request
	 * @return
	 */
	TblBenefitPackageDto getOnSaleBenefitPackage(GetOnSaleBenefitPackageRequest request);

	/**
	 * 查询权益包支付记录
	 * 
	 * @param uid
	 * @param request
	 * @return
	 */
	TblBenefitPurchaseRecordDto getBenefitPurchaseRecord(Long uid, GetBenefitPurchaseRecordRequest request);

	/**
	 * 支付成功处理
	 * 
	 * @param uid
	 * @param request
	 * @return
	 */
	Boolean handlePaySuccess(Long uid, HandlePaySuccessRequest request);

	/**
	 * 支付取消处理
	 * 
	 * @param uid
	 * @param request
	 * @return
	 */
	Boolean handlePayCancel(Long uid, HandlePayCancelRequest request);

	/**
	 * 查询权益包未支付记录
	 * 
	 * @param uid
	 * @param request
	 * @return
	 */
	TblBenefitPurchaseRecordDto getUnPayBenefitPurchaseRecord(Long uid, GetUnPayBenefitPurchaseRecordRequest request);

	/**
	 * 保存权益包未支付记录
	 * 
	 * @param uid
	 * @param saveDto
	 * @return
	 */
	Long saveUnPayBenefitPurchase(Long uid, SaveBenefitPurchaseUnPayDto saveDto);

	UserInfoResponse userInfo(Long uid);

	/**
	 * 人拥有的资产
	 * 
	 * @param assetId
	 * @param appUid
	 * @return
	 */
	AssetAccountResponse accountInfoCheckAmount(Long assetId, Long appUid);

	/**
	 * 资产的静态资产祥情
	 * 
	 * @param assetId
	 * @param appUid
	 * @return
	 */
	AssetStaticResponse staticInfoWithAssetId(Long assetId);

	TransactionResponse queryPaySyncOne(String buyUserId, Long orderId);

	List<UserInfoResponse> batchInfo(Collection<Long> appUids);

	AssetAllInfoResponse benefitPackageBaseInfo(Long benefitPackageId);

	AssetUserLogResponse lastConfig(Long assetId);

	AssetAuditResponse assetAuditInfo(Long assetAuditId);

	Boolean saveUpChainFlag(String appUid, Long businessRefId);

	Boolean handleOrderPaySuccess(TblPayOrderDto payOrderDto);

	AssetAccountResponse accountInfoUnCheckAmount(Long assetId, Long appUid);

	AssetNoResponse assetNoInfoWithNoId(Long noId);

	AssetAccountResponse accountInfoWithId(Long accountId);

	AssetExtInfoResponse extInfoWithAssetId(Long assetId);

	List<TblBenefitPackageDto> getPackageByIds(List<Long> packageIds);

}
